<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_enginname"></div></div>
            <div class="tuo"><div class="tit">结算单号</div><div class="con" id="tong_number"></div></div>
            <div class="tuo"><div class="tit">结算类型</div><div class="con" id="tong_jietype"></div></div>
            <div class="tuo"><div class="tit">本次结算金额(元)</div><div class="con" id="tong_money"></div></div>
            <div class="tuo"><div class="tit">结算日期</div><div class="con" id="tong_jiedt"></div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">收入合同信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">收入合同名称</td><td id="shiid_name" class=" colorlan tv"></td><td class="tt">已结算金额(元)</td><td id="shijiemoney" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">本次结算信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">结算单号</td><td id="number" class="tv"></td><td class="tt">结算类型</td><td id="jietype" class="tv"></td></tr>
                <tr><td class="tt">结算主题</td><td class="tv" id="title" colspan="3"></td></tr>
                <tr><td class="tt">本次结算金额(元)</td><td id="money" class="tv"></td><td class="tt">扣罚款金额(元)</td><td id="koufafee" class="tv"></td></tr>
                <tr><td class="tt">结算净额(元)</td><td id="jingfee" class="tv"></td><td class="tt">结算日期</td><td id="jiedt" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>

    <div class="showrrboxtext">
        <div class="table-box tablenes">
            <div class="title">收入合同</div>
            <div class="tuo"><div class="tit">收入合同金额含补充(元)</div><div class="con" id="right_shimoney">0</div></div>
            <div class="tuo"><div class="tit">项目签证金额含税(元)</div><div class="con" id="right_visamoney">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">合同结算</div>
            <div class="tuo"><div class="tit">进度结算金额(元)</div><div class="con" id="right_shijiejinmoney">0</div></div>
            <div class="tuo"><div class="tit">最终结算金额(元)</div><div class="con" id="right_shijiemoney">0</div></div>
            <div class="tuo"><div class="tit">结算扣罚款金额(元)</div><div class="con" id="right_shijiekoufafee">0</div></div>
            <div class="tuo"><div class="tit">收入合同结算净额(元)</div><div class="con" id="right_shijiejingfee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">开票/回款</div>
            <div class="tuo"><div class="tit">项目开票金额(元)</div><div class="con" id="right_kai_money">0</div></div>
            <div class="tuo"><div class="tit">工程回款金额(元)</div><div class="con" id="right_shougonghuifee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">待回款</div>
            <div class="tuo"><div class="tit">待回款按合同(元)</div><div class="con" id="right_daihuifee_anhe">0</div></div>
            <div class="tuo"><div class="tit">待回款按开票(元)</div><div class="con" id="right_daihuifee_ankai">0</div></div>
            <div class="tuo"><div class="tit">待回款按结算(元)</div><div class="con" id="right_daihuifee_anjie">0</div></div>
        </div>
    </div>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_contract_shi_jie_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                var shiinfo = res.data.shiinfo;

                $("#flowdingname").text(data.title);


                if(engininfo){
                    $("#tong_enginname").text(engininfo.name);
                }
                $("#tong_number").text(data.number);
                $("#tong_jietype").text(data.jietype);
                $("#tong_money").text(parseFormatNum(data.money));
                $("#tong_jiedt").text(data.jiedt);


                if(engininfo){
                    $("#right_shimoney").text(parseFormatNum(engininfo.shimoney)).addClass('colorlan').click(function () {
                        openNavPage('查看收入合同信息','contract_shi/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#right_visamoney").text(parseFormatNum(engininfo.visamoney)).addClass('colorlan').click(function () {
                        openNavPage('查看项目签证信息','engin_visa/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#right_shijiejinmoney").text(parseFormatNum(engininfo.shijiejinmoney)).addClass('colorlan').click(function () {
                        openNavPage('查看收入合同结算信息','contract_shi_jie/index.php?status=1&enginid='+engininfo.id+'&jietype='+encodeURIComponent('进度结算'));
                    });
                    $("#right_shijiemoney").text(parseFormatNum(engininfo.shijiemoney)).addClass('colorlan').click(function () {
                        openNavPage('查看收入合同结算信息','contract_shi_jie/index.php?status=1&isreal=1&enginid='+engininfo.id);
                    });
                    $("#right_shijiekoufafee").text(parseFormatNum(engininfo.shijiekoufafee)).addClass('colorlan').click(function () {
                        openNavPage('查看收入合同结算信息','contract_shi_jie/index.php?status=1&isreal=1&enginid='+engininfo.id);
                    });
                    $("#right_shijiejingfee").text(parseFormatNum(engininfo.shijiejingfee)).addClass('colorlan').click(function () {
                        openNavPage('查看收入合同结算信息','contract_shi_jie/index.php?status=1&isreal=1&enginid='+engininfo.id);
                    });
                    $("#right_kai_money").text(parseFormatNum(engininfo.kai_money)).addClass('colorlan').click(function () {
                        openNavPage('查看项目开票信息','piao_kai/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#right_shougonghuifee").text(parseFormatNum(engininfo.shougonghuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收款信息','shou_xiang/index.php?status=1&feilei_option=xmsr_gchk&enginid='+engininfo.id);
                    });
                    $("#right_daihuifee_anhe").text(parseFormatNum(engininfo.daihuifee_anhe));
                    $("#right_daihuifee_ankai").text(parseFormatNum(engininfo.daihuifee_ankai));
                    $("#right_daihuifee_anjie").text(parseFormatNum(engininfo.daihuifee_anjie));
                }









                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                }
                if(shiinfo){
                    $("#shiid_name").text(shiinfo.name).click(function () {
                        openPage('../contract_shi/show.php?id='+shiinfo.id);
                    });
                    $("#shijiemoney").text(engininfo.shijiemoney);
                }

                $("#number").text(data.number);
                $("#jietype").text(data.jietype);
                $("#title").text(data.title);
                $("#money").text(showChineseNumber(data.money));
                $("#koufafee").text(showChineseNumber(data.koufafee));
                $("#jingfee").text(showChineseNumber(data.jingfee));
                $("#jiedt").text(data.jiedt);
                $("#explain").text(data.explain);


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('contract_shi_jie', param_id);
    });



</script>
</body>
</html>




